//
//  SecondViewController.m
//  界面通信
//
//  Created by dllo on 16/7/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()
@property (nonatomic,strong) UITextField *field;
@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(80, 200, 100, 40)];
//    field.text = @"标题";
//    field.backgroundColor = [UIColor blackColor];
//    field.alpha = 0.3;
//    field.textColor = [UIColor whiteColor];
//    [self.view addSubview:field];
//    field.text = _contents;
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(70, 300, 70, 30);
    button.backgroundColor = [UIColor redColor];
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [button setTitle:@"小子" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];

    
}

- (void)buttonClicked:(UIButton *)button
{
    UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(80, 200, 100, 40)];
        field.text = @"标题jhjhj";
    field.backgroundColor = [UIColor blackColor];
    field.alpha = 0.3;
    field.textColor = [UIColor whiteColor];
    [self.view addSubview:field];
//    field.text = _contents;
    [self.secondDelegate changeValue:field.text];
    [self.navigationController popToRootViewControllerAnimated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
